<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../plugins/layui/css/layui.css" />
		<script src="../plugins/layui/layui.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>

		<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
			<legend>添加商品</legend>
		</fieldset>
		<div style="width: 80%;margin: 0px auto;">
			<form class="layui-form layui-form-pane" action="#" method="post">

				<div class="layui-form-item">
					<label class="layui-form-label">单行输入框</label>
					<div class="layui-input-block">
						<input type="text" name="title" lay-verify="username" autocomplete="off" placeholder="请输入标题" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">单行输入框</label>
					<div class="layui-input-block">
						<input type="password" name="title" lay-verify="pwd" autocomplete="off" placeholder="请输入标题" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">单选框</label>
					<div class="layui-input-block">
						<input type="radio" name="sex" value="男" title="男" checked="">
						<input type="radio" name="sex" value="女" title="女">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">下拉列表</label>
					<div class="layui-input-block">

						<select lay-search>
							<option value="">--请选择--</option>
							<option>aaa</option>
							<option>bbb</option>
							<option>ccc</option>
							<option>中文</option>
						</select>

					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label">时间组件</label>
					<div class="layui-input-block">
						
						<input type="text" name="date" class="layui-input" id="mydate" value="" />
						
					</div>
				</div>
				
				<div class="layui-form-item">
					<button class="layui-btn" lay-submit="" lay-filter="demo2">跳转式提交</button>
				</div>
			</form>
		</div>
		<script type="text/javascript">
			layui.use(["form","laydate"], function() {
				var form = layui.form;
				var laydate = layui.laydate;
				
				laydate.render({
					elem:"#mydate",
					type:'datetime',
					range:false,
					format:'yyyy年MM月dd日',
					calendar:true
				});
				form.verify({
					username:[/^\w{4,6}$/,"用户名密码4~6位!"],
					pwd:[/^\w{6,8}$/,"密码输入 错误!"]
				});
			});
		</script>
	</body>

</html>